<?php
/**
 *
 * identify the user
 * @author fylmetal
 *
 */
DEFINE ('DB_USER', 'root');
DEFINE ('DB_PASSWORD', 'root');
DEFINE ('DB_HOST', 'localhost');
DEFINE ('DB_NAME', 'irrealworld');

$nick=$_REQUEST['nickname'];
$pw=$_REQUEST['pw'];
$pw = md5($pw);
$dbc = @mysqli_connect (DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die
('Could not connect to MySQL: '.mysqli_connect_error() );

$q = "SELECT '$nick' FROM authorization_t WHERE password='$pw';";
$r = @mysqli_query ($dbc, $q); // Run the query.

if ($r) { 
	echo '<h1>Right password!</h1>';
} else { 
	echo '<h1>Wrong Datas!</h1>';
	echo mysql_errno($dbc) . ": " . mysql_error() . "\n";
}



?>